oj_path = ../oj/
utility_path = ../utility/
handler_poll_path = ../handler_poll/
handler_path = ../handler/
task_path = ../task/
deserialization_path = ../deserialization/

CFLAGS = -I$(utility_path) -I$(oj_path) -I$(handler_poll_path) -I$(handler_path) -I$(task_path) -I$(deserialization_path)
LIBS   = -lcurl -lpthread -lrt

test: test.o poj_proxy_process.o poj_handler.o gvj.o poj.o
	g++ test.o poj_proxy_process.o poj_handler.o gvj.o poj.o  -o test $(CFLAGS) $(LIBS)
	make clean

test.o: test.cpp
	g++ -c test.cpp -o test.o $(CFLAGS) $(LIBS)

poj_proxy_process.o: poj_proxy_process.cpp
	g++ -c poj_proxy_process.cpp -o poj_proxy_process.o $(CFLAGS) $(LIBS)

poj_handler.o: $(handler_path)poj_handler.cpp
	g++ -c $(handler_path)poj_handler.cpp -o poj_handler.o $(CFLAGS) $(LIBS)

poj.o: $(oj_path)poj.cpp
	g++ -c $(oj_path)poj.cpp -o poj.o $(CFLAGS) $(LIBS)

gvj.o: $(utility_path)gvj.cpp
	g++ -c $(utility_path)gvj.cpp -o gvj.o $(CFLAGS) $(LIBS)

clean:
	rm -v *.o
